-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Newest roboclaw_python_library and various changes #26
Open
uweswrtz
wants to merge
20
commits into
sonyccd:master
Choose a base branch
from
uweswrtz:newest_library
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SYMPTOM: self.TICKS_PER_METER is always at default value, regardless of value in roboclaw.launch or any other parameter server. CAUSE: A typo in call to rospy.get_param() means it is trying to retrieve a value that does not exist, instead of the intended parameter value. FIX: Add missing 's' to properly retrieve 'ticks_per_meter' value
SYMPTOM: Unpredictable erros occurring at runtime File "roboclaw_node.py", line 232, in run rospy.logdebug(" Encoders %d %d" % (enc1, enc2)) TypeError: %d format: a number is required, not NoneType CAUSE: Error when calling roboclaw.ReadEnc would result in encoder values 'enc1' or 'enc2' to be None instead of a number. This triggers TypeError as described above. FIX: Do exactly what TypeError wants us to do: make sure both 'enc1' and 'enc2' are numbers before trying to format them as numbers for logging. (Note this does not address root cause of ReadEnc failure, that will be submitted as a separate fix.) REFERENCE: Python number check courtesy of StackOverflow: https://stackoverflow.com/questions/3441358/what-is-the-most-pythonic-way-to-check-if-an-object-is-a-number
SYMPTOM: Unpredictable errors when calling roboclaw API, manifesting in several different forms such as "OSError: 11" CAUSE: The roboclaw API is not thread-safe, but we have three different threads potentially calling into the API simultaneously. When this occurs, errors follow. 1. self.run for our '/odom' publisher thread 2. self.cmd_vel_callback as '/cmd_vel' subscriber 3. self.check_vitals running for diagnostics FIX: Use a threading.Lock() object to synchronize usage of roboclaw API object. Thereby ensuring only one thread will be communicating with roboclaw at any given time. REFERENCES: ROS Python API Threading Model https://answers.ros.org/question/9543/rospy-threading-model/ StackOverflow "Semaphores on Python" https://stackoverflow.com/questions/31508574/semaphores-on-python
SYMPTOM: When robot turns right, /odom pose orientation turns left. (And vice versa.) However, the odom->base_link transform is correct. CAUSE: Encoder odometry entry point update_publish(enc_left,enc_right) is invoked with update_publish(enc1, enc2). But this is backwards. As per cmd_vel_callback, motor 1 is the right-hand side motor and motor 2 the left-hand side. As a result odometry calculations are reversed. Why does the odom->base_link transform look OK? An earlier change added a negative sign in front of the published transform angle. This only masked the error without fixing the underlying cause, resulting in reversed /odom data and leaving variables like self.last_enc_right holding the wrong values. FIX: Reverse the parameters when calling update_publish so they are correct. And now that the underlying problem is addressed, the negative sign must be removed from the angle when publishing transform.
Fix typo when reading ticks_per_meter parameter
merge changes
- according to docu rev. 5.4 - for firmware 4.1.34
callen5914
approved these changes
Dec 15, 2021
Quality Gate failedFailed conditions See analysis details on SonarCloud Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@sonyccd, even if you don't have time to maintain this project, here is pull request with some changes: